package com.dmm.vod.controller;


import com.dmm.result.Result;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/vod/user")
//@CrossOrigin
public class UserController {

    @PostMapping("/login")
    public Result login(){

//        {"code":20000,"data":{"token":"admin-token"}}
        Map<String,String> map=new HashMap();
        map.put("token","admin-token");
        return Result.success(map);
    }

    @GetMapping("/info")
    public Result info(){

//        {"code":20000,"data":{"roles":["admin"],
//        "introduction":"I am a super administrator",
//        "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
//        "name":"Super Admin"}}
        Map<String,String> map=new HashMap();
        map.put("roles","admin");
        map.put("introduction","I am a super administrator");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("name","Super Admin");
        return Result.success(map);
    }

    @PostMapping("logout")
    public Result logout(){
        return Result.success(null);
    }







}
